﻿Imports System.Data
Imports System.Data.Odbc
Imports WSEntidades
Public Class SalidasFact
    Public Shared Function Build(ByVal dr As OdbcDataReader) As SalidasBE
        Dim tmpSalidas As SalidasBE = New SalidasBE()
        Try
            With tmpSalidas
                .Cargo = convertDTFromDb.ConvertString(dr.Item("Cargo"))
                .ClaProvee = convertDTFromDb.ConvertString(dr.Item("ClaProvee"))
                .Comentarios = convertDTFromDb.ConvertString(dr.Item("Comentarios"))
                .Concepto = convertDTFromDb.ConvertString(dr.Item("Concepto"))
                .FecDev = convertDTFromDb.convertDateTime(dr.Item("FecDev"))
                .Fecha = convertDTFromDb.convertDateTime(dr.Item("Fecha"))
                .FolioE = convertDTFromDb.ConvertString(dr.Item("FolioE"))
                .IdAlmacen = convertDTFromDb.ConvertString(dr.Item("IdAlmacen"))
                .IdAlmRec = convertDTFromDb.ConvertString(dr.Item("IdAlmRec"))
                .IdCCosto = convertDTFromDb.ConvertString(dr.Item("IdCCosto"))
                .IdCliente = convertDTFromDb.ConvertString(dr.Item("IdCliente"))
                .IdEmpresa = convertDTFromDb.ConvertShort(dr.Item("IdEmpresa"))
                .IdMoneda = convertDTFromDb.ConvertString(dr.Item("IdMoneda"))
                .IdObra = convertDTFromDb.ConvertString(dr.Item("IdObra"))
                .IVA = convertDTFromDb.ConvertDecimal(dr.Item("IVA"))
                .NumCuenta = convertDTFromDb.ConvertString(dr.Item("NumCuenta"))
                .NumEnt = convertDTFromDb.convertInt32(dr.Item("NumEnt"))
                .NumFactura = convertDTFromDb.ConvertString(dr.Item("NumFactura"))
                .NumSal = convertDTFromDb.convertInt32(dr.Item("NumSal"))
                .Periodo = convertDTFromDb.convertInt32(dr.Item("Periodo"))
                .Referencia = convertDTFromDb.ConvertString(dr.Item("Referencia"))
                .SalDiv = convertDTFromDb.ConvertString(dr.Item("SalDiv"))
                .Serie = convertDTFromDb.ConvertString(dr.Item("Serie"))
                .Status = convertDTFromDb.ConvertString(dr.Item("Status"))
                .Subtotal = convertDTFromDb.ConvertDecimal(dr.Item("Subtotal"))
                .TipoSal = convertDTFromDb.ConvertString(dr.Item("TipoSal"))
                .Total = convertDTFromDb.ConvertDecimal(dr.Item("Total"))
                .UsuEnvia = convertDTFromDb.ConvertString(dr.Item("UsuEnvia"))
            End With
            Return tmpSalidas
        Catch ex As Exception
            Throw
        Finally
            tmpSalidas = Nothing
        End Try
    End Function
End Class
